package com.nengchuan.eic.nceconomy.dao;

import com.nengchuan.eic.nceconomy.entity.po.TemplateDic;
import com.nengchuan.eic.nceconomy.entity.po.TemplateFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nengchuan.eic.nceconomy.entity.vo.SheetInfoVO;
import com.nengchuan.eic.nceconomy.entity.vo.SheetVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 模板文件表 Mapper 接口
 * </p>
 *
 * @author luoping
 * @since 2020-04-23
 */
@Repository
public interface TemplateFileMapper extends BaseMapper<TemplateFile> {

    TemplateFile getIdByCategoryCodeAndProjectCode(@Param("categoryIndex") String categoryIndex,
                                           @Param("projectIndex")String projectIndex);

    /**
     * 获取模板数据
     * @param templateId
     * @param sheetId
     * @return
     */
    List<TemplateDic> getTemplate(@Param("templateId") Long templateId, @Param("sheetId")Long sheetId);

    /**
     * 获取模板sheet信息
     * @param categoryIndex
     * @param projectIndex
     * @return
     */
    SheetInfoVO getSheetInfo(@Param("categoryIndex")String categoryIndex, @Param("projectIndex")String projectIndex,@Param("sheetId")Long sheetId);

    /**
     * 根据阶段查询模板下的sheetList
     * @param categoryIndex
     * @param projectIndex
     * @return
     */
    List<SheetVO> selectSheetList(@Param("categoryIndex")String categoryIndex, @Param("projectIndex")String projectIndex);

    List<TemplateDic> selectSheetDetailOnParentNode(@Param("templateId") Long templateId, @Param("sheetId")Long sheetId);

}
